package test;

public class Client {
    public static void main(String[] args) {
        String salaryRecords =XMLUtils.getBean("stringValue");
        String filePath =XMLUtils.getBean("filePath");
        DataSourceDecorator encoded = new CompressionDecorator(new EncryptionDecorator(new FileDataSource(filePath)));

        encoded.writeData(salaryRecords);
        EncryptionDecorator plain = new EncryptionDecorator(encoded);

        System.out.println("Input ----------------");
        System.out.println(salaryRecords);
        System.out.println("Encoded --------------");
        System.out.println(plain.encode(filePath));
        System.out.println("Decoded --------------");
        System.out.println(encoded.readData());
    }
}
